package main

import (
	"github.com/gin-gonic/gin"
	"jjqzplucky.site/sz-core/internal/models"
	"jjqzplucky.site/sz-core/internal/routes"
	"jjqzplucky.site/sz-core/pkg/minio_client"
)

func init() {
	minio_client.InitMinioClient()
}

func main() {
	db, err := models.ConnectDatabase()
	if err != nil {
		return
	}
	r := gin.Default()
	// 注册路由
	routes.RegisterRoutes(r)
	err = r.Run(":9528")
	if err != nil {
		return
	}

	sqlDB, err := db.DB()
	if err != nil {
		return
	}
	err = sqlDB.Close()
	if err != nil {
		return
	}

}
